const arrayDefault = () => [];
const objectDefault = () => ({});
const genProp = (t, d) => ({ type: t, default: d });

// 通用 设置属性
let settingProps = {
  field: {
    type: Object,
    default: () => ({})
  },
  fields: {
    type: Array,
    default: () => []
  },
  mode: {
    type: String,
    default: ''
  },
  setting: {
    type: Object,
    default: () => ({})
  },
  showJsCodeBlock: {
    type: Boolean,
    default: ()=> false
  },
  /**工单自定义字段 */
  isShowRelationTask: {
    type: Boolean,
    default: ()=> false
  },
}
// 通用 预览属性
let previewProps = {
  field: {
    type: Object,
    default: () => ({})
  },
  setting: {
    type: Object,
    default: () => ({})
  },
  mode: {
    type: String,
    default: ''
  },
  
}
/** 
 * @description 通用 视图属性 
*/
let viewProps = {
  field: {
    type: Object,
    default: () => ({})
  }
}

// 表单列表数据
export const fields = genProp(Array, arrayDefault);
// 表单字段数据
export const field = genProp(Object, objectDefault);
// 表单模式
export const mode = genProp(String, '');
// 表单设置
export const setting = genProp(Object, objectDefault);
// 表单value
export const stringValue = genProp(String, '');
export const arrayValue = genProp(Array, arrayDefault);
export const objectValue = genProp(Object, objectDefault);

export {
  previewProps,
  settingProps,
  viewProps
}

export default {
  fields,
  field,
  mode,
  setting,
  stringValue,
  arrayValue,
  objectValue
}
